<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>头像二级菜单</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        img {
            /* 去掉图片下方的留白 */
            vertical-align: middle;
        }

        .header {
            padding: 0 100px;
            height: 60px;
            background-color: burlywood;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo {
            width: 250px;
            height: 40px;
            background-color: #fff;
        }

        .menu {
            width: 550px;
            height: 40px;
            background-color: #fff;
        }

        .avatar {
            position: relative;
        }

        .avatar>img {
            width: 40px;
            height: 40px;
            border-radius: 50%;

        }

        .sub-menu {
            width: 300px;
            height: 500px;
            background-color: brown;
            position: absolute;
            right: 0;
            top: 50px;
            border-radius: 20px;
            display: none;
        }

        .avatar:hover .sub-menu {
            display: block;
        }
    </style>
</head>

<body>
    <div class="header">
        <!-- 左边：logo -->
        <div class="logo"></div>

        <!-- 导航菜单 -->
        <div class="menu"></div>
        <!-- 工具栏 -->

        <div class="avatar">
            <img src="./images/bz04.jpg" alt="">
            <!-- 二级菜单 -->
            <div class="sub-menu"></div>
        </div>
    </div>
</body>

</html>